Skip to content

fix(http): include request URL on ApiError#310

Merged
HardlyDifficult merged 1 commit intomainfrom
fix/api-error-include-request-url
Mar 19, 2026
Merged

fix(http): include request URL on ApiError#310
HardlyDifficult merged 1 commit intomainfrom
fix/api-error-include-request-url

Conversation

@HardlyDifficult
Copy link
Collaborator

@HardlyDifficult HardlyDifficult commented Mar 19, 2026

Summary

Append [request: METHOD url] to ApiError messages when Axios provides error.config (helps debug wrong base URL / 404s).

Release

Publish v0.0.192 after merge.

Related


Note

Low Risk
Low risk: only changes error-message formatting by appending Axios method/url when available, plus a package version bump.

Overview
Improves HttpClient error diagnostics by appending [request: METHOD url] to ApiError messages when Axios provides error.config.url, making 404s/misconfigured base URLs easier to reproduce.

Bumps package version from 0.0.127 to 0.0.192.

Written by Cursor Bugbot for commit 05f9da5. This will update automatically on new commits. Configure here.

Summary by CodeRabbit

  • Chores

    • Version updated to 0.0.192
  • Bug Fixes

    • Enhanced error messages to include HTTP request method and URL details for better debugging and diagnostics

Append [request: METHOD url] when error.config is present to ease
debugging proxy/404 mismatches.

Bump to 0.0.192 for release.
@claude
Copy link

claude bot commented Mar 19, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

@coderabbitai
Copy link

coderabbitai bot commented Mar 19, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1b736010-06ad-474e-a20d-eec4f480e2c0

📥 Commits

Reviewing files that changed from the base of the PR and between 81964ce and 05f9da5.

📒 Files selected for processing (2)
  • package.json
  • src/core/http/HttpClient.ts

📝 Walkthrough

Walkthrough

Updated package version from 0.0.127 to 0.0.192. Enhanced HTTP client error handling to append request method and URL details to API error messages when request configuration is available.

Changes

Cohort / File(s) Summary
Version Update
package.json
Bumped npm package version from 0.0.127 to 0.0.192.
Error Message Enhancement
src/core/http/HttpClient.ts
Enhanced handleRequestError method to append request method (defaulting to 'GET') and URL from error.config to the composed ApiError message when available.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: appending request URL information to ApiError messages in the HTTP client.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/api-error-include-request-url
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@HardlyDifficult HardlyDifficult enabled auto-merge (squash) March 19, 2026 19:06
Copy link
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.


// Non-standard bodies (e.g. reverse-proxy "404 page not found") rarely include Canton fields; the URL is the best repro hint.
if (error.config?.url) {
msg += ` [request: ${error.config.method ?? 'GET'} ${error.config.url}]`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Axios method is lowercase, inconsistent with uppercase fallback

Low Severity

Axios normalizes config.method to lowercase internally (e.g. 'get', 'post'), so this will produce messages like [request: get https://…] instead of the conventional uppercase form. The uppercase 'GET' fallback reveals the intent was to display methods in uppercase, but .toUpperCase() is missing on error.config.method, creating an inconsistency between the normal and fallback paths.

Fix in Cursor Fix in Web

@HardlyDifficult HardlyDifficult merged commit 6d8eec2 into main Mar 19, 2026
8 of 9 checks passed
@HardlyDifficult HardlyDifficult deleted the fix/api-error-include-request-url branch March 19, 2026 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant